// utils/router.js
export function navigateTo(options) {
  const userInfo = wx.getStorageSync('userInfo')
  
  if (!userInfo?.token) {
    wx.showToast({
      title: '请先登录',
      icon: 'none',
      success: () => {
        wx.reLaunch({
          url: '/pages/login/index'
        })
      }
    })
    return Promise.reject('未登录')
  }
  return wx.navigateTo(options)
}